<#assign menuId=6>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>客户管理-${Application.systemName!}</title>
        <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
        <!-- bootstrap 3.0.2 -->
        <link href="../css/bootstrap.min.css" rel="stylesheet" type="text/css" />
        <!-- font Awesome -->
        <link href="../css/font-awesome.min.css" rel="stylesheet" type="text/css" />
        <!-- Ionicons -->
        <link href="../css/ionicons.min.css" rel="stylesheet" type="text/css" />
        <!-- Theme style -->
        <link href="../css/AdminLTE.css" rel="stylesheet" type="text/css" />

        
        
        <script type="text/javascript" src="../js/jquery.min.js"></script>
        <link href="../css/myself.css" rel="stylesheet" type="text/css" />
        <style>
        	i{
        		cursor: pointer;
        	}
        	label {
			    font-weight: normal;
			}
			.table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {
			    vertical-align: middle;
			}
			.find-row label{
				padding: 0 5px;
			} 
        	.new_drop {
			    min-width: 97px;
			  }
			 
			  
        	
        	
        	
        	
        </style>
    </head>
    <body class="skin-blue">
        <!-- header logo: style can be found in header.less -->
        <#include "../header.html"/>
        <div class="wrapper row-offcanvas row-offcanvas-left">
            <!-- Left side column. contains the logo and sidebar -->
            <#include "../menu.html"/>

            <!-- Right side column. Contains the navbar and content of the page -->
           <aside class="right-side">
           	<section class="content-header">
                    <h1>客户管理</h1>
                    
                    <#if (Session["permisionMap"]["F500"]??)>
				                		
                    <div class="pull-right" style="position: absolute; top: 10px; right: 20px">
                        <button type="button" class="btn btn-primary" id="add_customer">新增客户</button>
                    </div>
                    </#if>
                    <hr style="margin: 10px 0 0 0;" />
            </section>
            <section class="content">
            	<div class="row">
            		<div class="col-md-12">
            			<div class="box">
            				<div class="clearfix search-div center">
                            	<div class="design-order-top clearfix"  style="margin-bottom: 15px;">
					                <div  class="fl clearfix">
					                 	<div class="btn-group" data-toggle="btn-toggle">
	                                        <button type="button" class="btn btn-default btn-md current" onclick="window.location.href='list';">全部</button>
	                                        <button type="button" class="btn btn-default btn-md" onclick="window.location.href='list?status=1';">已签约
	                                        	<#if signedCustomers!=0>
						                        	(${signedCustomers})
						                        </#if>
	                                        </button>
	                                        <button type="button" class="btn btn-default btn-md" onclick="window.location.href='list?status=2';">未签约
	                                        	 <#if potentialCustomers!=0>
						                        	(${potentialCustomers})
						                         </#if>
	                                        </button>
	                                    </div>
					                </div>
	            				</div>
	            				
	            				<div class="search1">
					            	<form action="list" method="post"> 
							       		<ul style="padding: 0"> 
							       			<li>
												<input type="text" value="${query.fullname!}" name="fullname" placeholder="输入客户名称或简称" />
							       			</li>
							       			<li>
												<select class="input-md" name="category" >
	                                                <option value="">请选择客户分类</option>
	                                               	<#if (query.category!)=="001">
														<option value="001" selected>淘卖</option>
													<#else>
														<option value="001">淘卖</option>
													</#if>
													<#if (query.category!)=="002">
														<option value="002" selected>品牌</option>
													<#else>
														<option value="002">品牌</option>
													</#if>
													<#if (query.category!)=="003">
														<option value="003" selected>网红</option>
													<#else>
														<option value="003">网红</option>
													</#if>
	                                        	</select>
							       			</li>
							       			<li>
												<input type="text" value="${query.productCategorys!}" name="productCategorys" placeholder="输入客户名产品分类" />
							       			</li>
							       		 	<li>
							       		 		<input type="text" value="${query.styleLabels!}" name="styleLabels" placeholder="输入客户风格标签" />
							       		 	</li>
							       		 	<input type="text" value="${query.status!}" hidden name="status"/>
							       			<li>
							       				<div>
				                                    <button type="submit" class="btn btn-primary btn-sm">搜索</button>
		                                		</div>
							       			</li>
							       		</ul>
							       		</form>
							       	</div> 
	            				
                            </div><!-- /.box-header -->
            				
            				
				            <div class="clearfix search-div center" style="margin-top: 0;">
						       	<div class="clearfix"></div>
						       	<form action="#" method="get">
						           	<table class="table table-bordered text-center">
						               	<tbody>
						                   	<tr>
						                       <th width="30%" style="border: none;">基本信息</th>
						                       <th width="14%" style="border: none;">分类</th>
						                       <th width="14%" style="border: none;">设计</th>
						                       <th width="14%" style="border: none;">打样</th>
						                       <th width="14%" style="border: none;">大货</th>
						                       <th width="14%" style="border: none;">操作</th>
						                   	</tr>
						               	</tbody>
						           	</table>
						           	<#if customerList?size!=0>
						           	<#list customerList as customer>
                                	<table class="table text-center table-bordered order-list">
						
						                   <tr>
						                       <td colspan="6" class="left-text" style="font-weight: bold"> 
						                           <span>客户编号：${customer.code!}</span>
						                       </td>
						                   </tr>
						
						                        <td width="30%"  style="vertical-align: top;">
						                            <#if customer.level=="V1">
						                            <i class="iconfont fl">&#xe6eb;</i>
						                            <#elseif customer.level=="V2">
						                            <i class="iconfont fl">&#xe6ed;</i>
						                            <#else>
						                            <i class="iconfont fl">&#xe6e9;</i>
						                            </#if>
						                            <div  class="order-text">
							                            <p>
							                            	<a href="doShowCustomerDetailPage?id=${customer.id!}"
							                            	<#if customer.abbreviation?? && customer.abbreviation!="">
								                            <span id="name">${customer.abbreviation!}（${customer.fullname!}）</span>
								                            <#else>
								                            <span id="name">${customer.fullname!}</span>
								                            </#if>
								                            </a>
								                            <#if customer.web??  && customer.web!="">
								                            <a href="${customer.web}"><i class="iconfont">&#xe6ee;</i></a>
								                            </#if>
								                            <#if customer.attachment?size!=0>
								                            <a class="download"><i class="iconfont" data-toggle="modal" data-target="#myModal1${customer_index}">&#xe6ef;</i></a>
								                            <div class="modal fade" id="myModal1${customer_index}"  tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
																<div class="modal-dialog down_load">
																	<div class="modal-content">
																		<div class="modal-header">
																			<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
																				&times;
																			</button>
																			<h4 class="modal-title">
																				下载列表
																			</h4>
																		</div>
																		<div class="modal-body">
																			<ul>
																				<#list customer.attachment as attach>
																				<li>
																					<div class="clearfix">
																						<a href="../businessfile/downFile?businessFileId=${attach.id!}"><img class="pull-left" src="../img/file.png" style="width: 60px; height: 60px; border-radius: 10px;"/></a>
																						<span class="pull-left" title="${attach.originName!}">${attach.originName!}</span>
																					</div>
																				</li>
																				</#list>
																			</ul>
																		</div>
																		<div class="modal-footer">
																			<button type="button" class="btn btn-default" data-dismiss="modal">关闭
																			<btton>
																		</div>
																	</div><!-- /.modal-content -->
																</div><!-- /.modal -->
															</div>
								                            </#if>
							                            </p>
							                            <#list customer.contacts as contact>
							                            <p>
							                            	<i class="iconfont">&#xe6f5;</i>
							                            	<span style="margin-right: 15px;">${contact.linkman!}</span>
							                            	<i class="iconfont">&#xe6f3;</i>
							                            	<span>${contact.contact!}</span>
							                            </p>
							                            </#list>
							                            <#if customer.memo?? && customer.memo!="">
							                            <span class="text_ellips">
							                            	<i class="iconfont">&#xe6f4;</i>&nbsp;&nbsp;客户备注：${customer.memo!}
							                            </span>
							                            </#if>
						                            </div>
						                        </td>
						                       <td width="14%">${customer.category!}</td>
						                       <td width="14%">${customer.designOrderCount!}</td>
						                       <td width="14%">${customer.proofingOrderCount!}</td>
						                       <td width="14%">${customer.productionOrderCount!}</td>
						                       <td width="14%">
						                       <#if (Session["permisionMap"]["F503"]??)>
				       
						                           	<div class="btn-group">
													  	<button type="button" class="btn btn-primary btn-sm dropdown-toggle" data-toggle="dropdown">
														创建订单 <span class="caret"></span>
														</button>
														<ul class="dropdown-menu dropdown-menu-right new_drop" role="menu">
														  	<li><a href="../designorder/addPage?customerId=${customer.id!}&customerName=${customer.fullname!}">设计订单</a></li>
														    <li><a href="#" data-toggle="modal" data-target="#myModal1">打样订单</a></li>
														</ul>
													</div>
													</#if>
													<#if (Session["permisionMap"]["F502"]??)>
				       
						                           <p><a href="doShowCustomerEditPage?id=${customer.id!}">编辑</a></p>
						                           </#if>
						                           <#if (Session["permisionMap"]["F501"]??)>
				       
						                           <p><a href="javascript:;" onclick="doRemoveCustomer('${customer.fullname!}',${customer.id!});">删除</a></p>
						                       </#if>
						                       </td>
						                       
						                       
						                      <!--创建打样订单弹框-->
									          	<div class="modal fade" id="myModal1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
													<div class="modal-dialog DaYang" >
														<div class="modal-content">
															<div class="modal-header">
																<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
																	&times;
																</button>
																
															</div>
															<div class="modal-body">
																<a href="../proofingorder/addSample?customerId=${customer.id!}&customerName=${customer.fullname!}" class="customers_a"  style="position: relative;">
																	<span>客户提供样衣</span>
																	<i class="iconfont icon_i1">&#xe6f1;</i>
																	<div class="bg_customer">
																		<img src="../img/ic_people.png">
																	</div>
																</a>
																<a href="../proofingorder/selectSample?customerId=${customer.id!}&customerName=${customer.fullname!}" class="yangyi_a" style="position: relative;">
																	<span>从样衣库中选择</span>
																	<i class="iconfont icon_i2">&#xe6f1;</i>
																	<div class="bg_customer">
																		<img src="../img/ic_cloth.png">
																	</div>
																</a>
															</div>
															
														</div><!-- /.modal-content -->
													</div><!-- /.modal -->
												</div>
						                       
						                       
						                       
						                       
						                       
						                       
						                       
						           	</table>
						           	</#list>
						           	</#if>
						       	</form>
							    <div class="box-footer clearfix">
                                    <ul class="pagination pagination-sm no-margin pull-right">
                                        ${splitPage?replace("{url}","${path}")}
                                    </ul>
                                </div>
				           	</div>
            			</div>
            		</div>
            	</div>
            </section>
            </aside><!-- /.right-side -->
        </div><!-- ./wrapper -->
        <!-- jQuery 2.0.2 -->
        <style type="text/css"></style>
        
        <!-- Bootstrap -->
        <script src="../js/bootstrap.min.js" type="text/javascript"></script>
        <!-- AdminLTE App -->
        <script src="../js/AdminLTE/app.js" type="text/javascript"></script>
		<script src="../js/customer/customer.js" type="text/javascript"></script>
		<script src="../js/common/common.js" type="text/javascript"></script>
		<script>
			$(function(){
				
				if('${query.status!}'==1){
					$('.design-order-top button').eq(1).addClass('active');
				}else if('${query.status!}'==2){
					$('.design-order-top button').eq(2).addClass('active');
				}else{
					$('.design-order-top button').eq(0).addClass('active')
				}
			});
			
		</script>
    </body>
</html>

